#!/bin/bash
mkdir "$1_random"
if [ $? -ne 0 ]; then
	exit
fi

mkdir "$1_static"
if [ $? -ne 0 ]; then
	exit
fi

mkdir "$1_inverted"
if [ $? -ne 0 ]; then
	exit
fi

strategy=0

echo "Strategy: Random"
#for it in 1 2 3
#do 
#	echo "Iterations $it begins"
	for i in 10 15 20 25 30 40 50 75 100 5 3 2
	do
		if [ $i -ne 1 ]; then
			echo "Simulations with threads: $i"
			/usr/bin/time -f "%C %e %U %S" -o "$1_random/times" --append ./bin/fmake $i $strategy > "$1_random/$i.thrs_$it"
		fi
	done
#done

echo "Strategy: Prioritiy"
strategy=1
for i in 10 15 20 25 30 40 50 75 100
do      
	echo "Simulations with threads: $i"
	/usr/bin/time -f "%C %e %U %S" -o "$1_static/times" --append ./bin/fmake $i $strategy > "$1_static/$i.thrs"
done


echo "Strategy: Inverted"
strategy=1
for i in 10 15 20 25 30 40 50 75 100 1
do
	echo "Simulations with threads: $i"
	/usr/bin/time -f "%C %e %U %S" -o "$1_inverted/times" --append ./bin/ifmake $i $strategy > "$1_inverted/$i.thr"
done  
